package com.cmower.baeldung.constructor1;

public class Writer {
    private String name;
    private int age;

public Writer() {
    this.name = "";
    this.age = 0;
}

public Writer(String name, int age) {
    this.name = name;
    this.age = age;
}

public Writer(String name) {
    this(name,18);
}

    @Override
    public String toString() {
        return "Writer{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public static void main(String[] args) {
Writer writer = new Writer();
System.out.println(writer.toString());

Writer writer1 = new Writer("沉默王二",18);
System.out.println(writer1.toString());
    }
}
